package com.kronos.game;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureWrap;

/** 
 * @author Eric Ofman
 *
 */
public class ParallaxLayer {

	public Texture texture;

	protected float positionX, positionY;
	private float ratioX, ratioY;

	protected int startY;

	public ParallaxLayer(Texture texture, int startY, float ratioX, float ratioY) {
		this.texture = texture;
		this.startY = startY;
		this.ratioX = ratioX;
		this.ratioY = ratioY;
		
		texture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);
	}

	protected void scrollRightX(float delta) {
		positionX += delta * ratioX;
	}

	protected void scrollRightY(float delta) {
		positionY += delta * ratioY;
	}
	
	protected void scrollLeftX(float delta) {
		positionX -= delta * ratioX;
	}

	protected void scrollLeftY(float delta) {
		positionY -= delta * ratioY;
	}
}